import { getListFn } from '../api/collect'
import { getZXCO } from '../utils/storage'
let state = {
  list: []
}
let mutations = {
  setList(state,obj) {
    state.list = obj.data
  }
}
let actions = {
  async getListFn({commit}) {
    let collectStr = getZXCO().join(',')
	if(!collectStr){
      commit('setList',[])
      return
    }
    let {data} = await getListFn({ids:collectStr})
    commit('setList',data)
  }
}

export default {
  namespaced: true,
  state,
  mutations,
  actions
}
